package com.party.mobile.web.dto.crowdfund.output;

import com.party.common.annotation.ExcelField;
import com.party.core.model.crowdfund.SupportWithMember;
import org.springframework.beans.BeanUtils;

import java.util.Date;
import java.util.List;

/**
 * 众筹支持者输出视图
 * Created by wei.li
 *
 * @date 2017/2/17 0017
 * @time 10:07
 */
public class SponsorOutput {

    //支持编号
    private String id;

    //支持者名称
    private String favorerName;

    //支持者图像
    private String favorerLogo;

    //支持评论
    private String comment;

    //创建时间
    private Date createDate;

    //付款金额
    private Float payment;

    //支持者手机号码
    private String favorerMobile;

    //回复列表
    private List<ProjectCommentOutput> replyList;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @ExcelField(title = "支持者名称",align = 2,sort = 1)
    public String getFavorerName() {
        return favorerName;
    }

    public void setFavorerName(String favorerName) {
        this.favorerName = favorerName;
    }

    public String getFavorerLogo() {
        return favorerLogo;
    }

    public void setFavorerLogo(String favorerLogo) {
        this.favorerLogo = favorerLogo;
    }

    @ExcelField(title = "支持评论",align = 2,sort = 4)
    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @ExcelField(title = "支持时间",align = 2,sort = 5)
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @ExcelField(title = "支持金额",align = 2,sort = 2)
    public Float getPayment() {
        return payment;
    }

    public void setPayment(Float payment) {
        this.payment = payment;
    }

    public List<ProjectCommentOutput> getReplyList() {
		return replyList;
	}

	public void setReplyList(List<ProjectCommentOutput> replyList) {
		this.replyList = replyList;
	}

    @ExcelField(title = "手机号码",align = 2,sort = 3)
    public String getFavorerMobile() {
        return favorerMobile;
    }

    public void setFavorerMobile(String favorerMobile) {
        this.favorerMobile = favorerMobile;
    }


    /**
     * 众筹支持者转输出视图
     * @param supportWithMember 众筹支持
     * @return 支持输出视图
     */
    public static SponsorOutput transform(SupportWithMember supportWithMember){
        SponsorOutput sponsorOutput = new SponsorOutput();
        BeanUtils.copyProperties(supportWithMember, sponsorOutput);
        return sponsorOutput;
    }
}
